All Questions
6 questions
2votes
2answers
5kviews
How to split text files by character count in directory
I would like to divide multiple text files in a directory into many smaller text files by a given character count. For example, I want each file in the directory to be divided into smaller text files ...
6votes
6answers
4kviews
split file into N pieces with same name but different target directories
I want to split sourcefile.txt which contains 10000 lines, (increasing everyday) into 30 equal files. I have directories called prog1 to prog30 and I would like to save split the file into these ...
10votes
1answer
7kviews
Splitting file based on size, but make sure that it ends with newline
I am able to use the split command successfully to split large file into multiple smaller files. This is being achieved by following command split -b 1G $temp_path $final_filepath But only caveat is ...
3votes
3answers
168views
How to split a file based on a list of patterns and name the output files asthe pattern?
File1 looks like this (metabolic pathway:gene): A:1 A:2 A:3 B:a B:b C:pp D:rr How to obtain an output file that looks like this (named as File1.new): A:1, 2, 3 B:a, b C:pp D:rr I am a ...
4votes
1answer
2kviews
How to set csplit output filenames by pattern?
Is there a way to set output names of csplit through the pattern? I want to split the ssh-config by hosts to corresponding files. If there is a solution without csplit I'm happy as well.
1vote
1answer
4kviews
Reading the contents of the file and splitting using ksh
We're using a ksh script for installing one product. I've another config file, I'd need to read this configuration file from my main script Content of the Configuration file: BPWS_Instance_1:Linux:...